package com.hinnotek.amoeba.repo

import com.hinnotek.amoeba.api.ApiService
import com.hinnotek.amoeba.base.BaseBean
import com.hinnotek.amoeba.bean.old.*
import com.lee.common.base.BaseRepository
import com.lee.common.network.net.StateLiveData
import okhttp3.RequestBody
import javax.inject.Inject

class NoticeRepo @Inject constructor(private val service: ApiService) : BaseRepository() {

    /**
     * app端阿米巴安装历史申请接口
     */
    suspend fun getAmibaInstallPageForHistory(
        applyUserId: Int,
        approvalUserId: String?,
        pageNo: Int,
        pageSize: Int,
        stateLiveData: StateLiveData<MutableList<AmibaInstallPageByUserIdBean>>
    ) {
        executeResp({
            service.getAmibaInstallPageForHistory(
                applyUserId,
                approvalUserId ?: "",
                pageNo,
                pageSize
            )
        }, stateLiveData)
    }

    /**
     * app端阿米巴安装历史申请接口
     */
    suspend fun getAmibaPayPageForHistory(
        applyUserId: Int,
        approvalUserId: String?,
        pageNo: Int,
        pageSize: Int,
        stateLiveData: StateLiveData<MutableList<AmibaProjectListByOrgIdBean>>
    ) {
        executeResp({
            service.getAmibaPayPageForHistory(
                applyUserId,
                approvalUserId ?: "",
                pageNo,
                pageSize
            )
        }, stateLiveData)
    }

    /**
     * app端阿米巴采购历史申请接口
     */
    suspend fun getAmibaPurchasePageForHistory(
        applyUserId: Int,
        approvalUserId: String?,
        pageNo: Int,
        pageSize: Int,
        stateLiveData: StateLiveData<MutableList<SellPurchaseRequistionBean>>
    ) {
        executeResp({
            service.getAmibaPurchasePageForHistory(
                applyUserId,
                approvalUserId ?: "",
                pageNo,
                pageSize
            )
        }, stateLiveData)
    }

   /**
     * app端阿米巴报销历史申请接口
     */
    suspend fun getAmibaReimbursePageForHistory(
        applyUserId: Int,
        approvalUserId: String?,
        pageNo: Int,
        pageSize: Int,
        stateLiveData: StateLiveData<MutableList<AmibaReimbursePageByUserIdBean>>
    ) {
        executeResp({
            service.getAmibaReimbursePageForHistory(
                applyUserId,
                approvalUserId ?: "",
                pageNo,
                pageSize
            )
        }, stateLiveData)
    }
    
   /**
     * app端阿米巴临时缴费续费历史申请接口
     */
    suspend fun getAmibaTemporaryePageForHistory(
        applyUserId: Int,
        approvalUserId: String?,
        pageNo: Int,
        pageSize: Int,
        stateLiveData: StateLiveData<MutableList<AmibaTemporaryePageByUserIdBean>>
    ) {
        executeResp({
            service.getAmibaTemporaryePageForHistory(
                applyUserId,
                approvalUserId ?: "",
                pageNo,
                pageSize
            )
        }, stateLiveData)
    }

   /**
     * app端阿米巴临时缴费续费历史申请接口
     */
    suspend fun getCompanyPurchasePageForHistory(
        applyUserId: Int,
        approvalUserId: String?,
        pageNo: Int,
        pageSize: Int,
        stateLiveData: StateLiveData<MutableList<CompanyPurchaseByUserIdBean>>
    ) {
        executeResp({
            service.getCompanyPurchasePageForHistory(
                applyUserId,
                approvalUserId ?: "",
                pageNo,
                pageSize
            )
        }, stateLiveData)
    }

   /**
     * app端公司手机号缴费历史申请接口
     */
    suspend fun getCompanyPhonePayPageForHistory(
        applyUserId: Int,
        approvalUserId: String?,
        pageNo: Int,
        pageSize: Int,
        stateLiveData: StateLiveData<MutableList<CompanyPhonePayPageByUserIdBean>>
    ) {
        executeResp({
            service.getCompanyPhonePayPageForHistory(
                applyUserId,
                approvalUserId ?: "",
                pageNo,
                pageSize
            )
        }, stateLiveData)
    }
    
   /**
     * app端公司手机号缴费历史申请接口
     */
    suspend fun getNoticeDetailById(
       noticeId: Int,
        stateLiveData: StateLiveData<AmibaInstallByIdBean>
    ) {
        executeResp({
            service.getNoticeDetailById(noticeId)
        }, stateLiveData)
    }
    
   /**
     * app端公司手机号缴费历史申请接口
     */
    suspend fun getAmibaInstallApproval(
       amibaInstallId: Int,
       approvalState: Int,
       noticeId: Int,
        stateLiveData: StateLiveData<BaseBean>
    ) {
        executeResp({
            service.amibaInstallApproval(amibaInstallId,approvalState,noticeId)
        }, stateLiveData)
    }

   /**
     * app端公司手机号缴费历史申请接口
     */
    suspend fun amibaPayApproval(
       amibaInstallId: Int,
       approvalState: Int,
       noticeId: Int,
        stateLiveData: StateLiveData<BaseBean>
    ) {
        executeResp({
            service.amibaPayApproval(amibaInstallId,approvalState,noticeId)
        }, stateLiveData)
    }

   /**
     * app端公司手机号缴费历史申请接口
     */
    suspend fun getCompanyPhonePayApproval(
       amibaInstallId: Int,
       approvalState: Int,
       noticeId: Int,
        stateLiveData: StateLiveData<BaseBean>
    ) {
        executeResp({
            service.companyPhonePayApproval(amibaInstallId,approvalState,noticeId)
        }, stateLiveData)
    }
 /**
     * app端公司手机号缴费历史申请接口
     */
    suspend fun getCompanyPurchaseApproval(
       amibaInstallId: Int,
       approvalState: Int,
       noticeId: Int,
        stateLiveData: StateLiveData<BaseBean>
    ) {
        executeResp({
            service.companyPurchaseApproval(amibaInstallId,approvalState,noticeId)
        }, stateLiveData)
    }

    suspend fun amibaPurchaseApproval(amibaPurchaseId: Int, approvalState: Int, noticeId: Int, refusalReasons: String, baseData: StateLiveData<BaseBean>) {
        executeResp({
            service.amibaPurchaseApproval(amibaPurchaseId,approvalState,noticeId,refusalReasons)
        }, baseData)
    }

    suspend fun getAmibaTemporaryApproval(amibaTemporaryId: Int, approvalState: Int, noticeId: Int, baseData: StateLiveData<BaseBean>) {
        executeResp({
            service.amibaTemporaryApproval(amibaTemporaryId,approvalState,noticeId)
        }, baseData)
    }

    suspend fun getAmibaReimburseApproval(amibaReimburseId: Int, approvalState: Int, noticeId: Int, refusalReasons: String, baseData: StateLiveData<BaseBean>) {
        executeResp({
            service.amibaReimburseApproval(amibaReimburseId,approvalState,noticeId,refusalReasons)
        }, baseData)
    }

    suspend fun getAllSysOrg(allSysOrg: StateLiveData<MutableList<AllSysOrg>>) {
        executeResp({
            service.getAllSysOrg()
        }, allSysOrg)
    }

    suspend fun getNoticePage(requestBody: RequestBody, noticePageByUserIdData: StateLiveData<MutableList<NoticePageByUserIdBean>>) {
        executeResp({
            service.getNoticePage(requestBody)
        }, noticePageByUserIdData)
    }

    suspend fun getNoticePageByUserId(requestBody: RequestBody, stateLiveData: StateLiveData<MutableList<NoticePageByUserIdBean>>) {
        executeResp({
            service.getNoticePageByUserId(requestBody)
        }, stateLiveData)
    }

    suspend fun getNoticePage2(searchId: Int, pageNo: String, pageNo1: Int, pageSize: Int, stateLiveData: StateLiveData<MutableList<NoticePageByUserIdBean>>) {
        executeResp({
            service.getNoticePage2(searchId,pageNo,pageNo1,pageSize)
        }, stateLiveData)
    }


}